﻿@namespace MudBlazor
@typeparam T
@inherits MudBooleanInput<T>

<MudInputControl Class="@Classname" Style="@Style" Error="@HasErrors" ErrorText="@GetErrorText()" Required="@Required">
    <InputContent>
        <label class="@LabelClassname" style="@Style" id="@_elementId" @onkeydown="@HandleKeyDownAsync" @onclick:stopPropagation="@StopClickPropagation">
            <span class="@IconClassname">
                <input @attributes="UserAttributes" tabindex="@(GetDisabledState() ? -1 : 0)" type="radio" class="mud-radio-input" aria-disabled="@(GetDisabledState().ToString().ToLower())" checked="@Checked" role="radio" name="@MudRadioGroup?.Name" disabled="@GetDisabledState()" @onclick:preventDefault="@GetReadOnlyState()" @onclick="OnClickAsync" />
                <MudIcon Disabled="@Disabled" Icon="@GetIcon()" Color="HasErrors ? Color.Error : Color.Inherit" Size="@Size" />
            </span>
            @if (!string.IsNullOrEmpty(Label))
            {
                <MudText Color="HasErrors ? Color.Error : Color.Inherit">@Label</MudText>
            }
            @if (ChildContent is not null)
            {
                <MudText Color="HasErrors ? Color.Error : Color.Inherit">
                    @ChildContent
                </MudText>
            }
        </label>
    </InputContent>
</MudInputControl>
